package com.zu.commu.landi2.protocol;

import com.zu.commu.exception.CommuException;
import com.zu.commu.util.DateTime;

public class ReturnData
{
  public static byte[] data()
    throws Exception
  {
    try
    {
      byte[] buf = new byte[14];
      buf[0] = 43;
      buf[1] = 76;
      buf[2] = 65;
      buf[3] = 78;
      buf[4] = 68;
      buf[5] = 83;
      buf[6] = 72;
      buf[7] = 65;

      String date = DateTime.yymmddhhmmss();

      buf[8] = (byte)Integer.parseInt(date.substring(0, 2), 16);
      buf[9] = (byte)Integer.parseInt(date.substring(2, 4), 16);
      buf[10] = (byte)Integer.parseInt(date.substring(4, 6), 16);
      buf[11] = (byte)Integer.parseInt(date.substring(6, 8), 16);
      buf[12] = (byte)Integer.parseInt(date.substring(8, 10), 16);
      buf[13] = (byte)Integer.parseInt(date.substring(10, 12), 16);

      return buf;
    } catch (Exception e) {
    }
    throw new CommuException().setMessage("分析日期" + DateTime.yymmddhhmmss() + "出错！", null);
  }
}